knitr::opts_chunk$set(echo = FALSE, message = FALSE)
library(Seurat)
library(ggplot2)
library(data.table)
library(MAST)
library(SingleR)
library(dplyr)
library(tidyr)
library(limma)
library(scRNAseq)
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.4
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] scRNAseq_2.2.0              limma_3.44.3               
##  [3] tidyr_1.1.1                 dplyr_1.0.2                
##  [5] SingleR_1.2.4               MAST_1.14.0                
##  [7] SingleCellExperiment_1.10.1 SummarizedExperiment_1.18.2
##  [9] DelayedArray_0.14.1         matrixStats_0.56.0         
## [11] Biobase_2.48.0              GenomicRanges_1.40.0       
## [13] GenomeInfoDb_1.24.2         IRanges_2.22.2             
## [15] S4Vectors_0.26.1            BiocGenerics_0.34.0        
## [17] data.table_1.13.0           ggplot2_3.3.2              
## [19] Seurat_3.2.0               
## 
## loaded via a namespace (and not attached):
##   [1] AnnotationHub_2.20.1          BiocFileCache_1.12.1         
##   [3] plyr_1.8.6                    igraph_1.2.5                 
##   [5] lazyeval_0.2.2                splines_4.0.2                
##   [7] BiocParallel_1.22.0           listenv_0.8.0                
##   [9] digest_0.6.25                 htmltools_0.5.0              
##  [11] magrittr_1.5                  memoise_1.1.0                
##  [13] tensor_1.5                    cluster_2.1.0                
##  [15] ROCR_1.0-11                   globals_0.12.5               
##  [17] colorspace_1.4-1              blob_1.2.1                   
##  [19] rappdirs_0.3.1                ggrepel_0.8.2                
##  [21] xfun_0.16                     crayon_1.3.4                 
##  [23] RCurl_1.98-1.2                jsonlite_1.7.0               
##  [25] spatstat_1.64-1               spatstat.data_1.4-3          
##  [27] survival_3.2-3                zoo_1.8-8                    
##  [29] ape_5.4-1                     glue_1.4.1                   
##  [31] polyclip_1.10-0               gtable_0.3.0                 
##  [33] zlibbioc_1.34.0               XVector_0.28.0               
##  [35] leiden_0.3.3                  BiocSingular_1.4.0           
##  [37] future.apply_1.6.0            abind_1.4-5                  
##  [39] scales_1.1.1                  DBI_1.1.0                    
##  [41] miniUI_0.1.1.1                Rcpp_1.0.5                   
##  [43] viridisLite_0.3.0             xtable_1.8-4                 
##  [45] reticulate_1.16               bit_4.0.4                    
##  [47] rsvd_1.0.3                    htmlwidgets_1.5.1            
##  [49] httr_1.4.2                    RColorBrewer_1.1-2           
##  [51] ellipsis_0.3.1                ica_1.0-2                    
##  [53] pkgconfig_2.0.3               uwot_0.1.8                   
##  [55] dbplyr_1.4.4                  deldir_0.1-28                
##  [57] tidyselect_1.1.0              rlang_0.4.7                  
##  [59] reshape2_1.4.4                later_1.1.0.1                
##  [61] AnnotationDbi_1.50.3          munsell_0.5.0                
##  [63] BiocVersion_3.11.1            tools_4.0.2                  
##  [65] generics_0.0.2                RSQLite_2.2.0                
##  [67] ExperimentHub_1.14.1          ggridges_0.5.2               
##  [69] evaluate_0.14                 stringr_1.4.0                
##  [71] fastmap_1.0.1                 yaml_2.2.1                   
##  [73] goftest_1.2-2                 knitr_1.29                   
##  [75] bit64_4.0.2                   fitdistrplus_1.1-1           
##  [77] purrr_0.3.4                   RANN_2.6.1                   
##  [79] pbapply_1.4-3                 future_1.18.0                
##  [81] nlme_3.1-148                  mime_0.9                     
##  [83] compiler_4.0.2                plotly_4.9.2.1               
##  [85] curl_4.3                      png_0.1-7                    
##  [87] interactiveDisplayBase_1.26.3 spatstat.utils_1.17-0        
##  [89] tibble_3.0.3                  stringi_1.4.6                
##  [91] lattice_0.20-41               Matrix_1.2-18                
##  [93] vctrs_0.3.2                   pillar_1.4.6                 
##  [95] lifecycle_0.2.0               BiocManager_1.30.10          
##  [97] lmtest_0.9-37                 RcppAnnoy_0.0.16             
##  [99] BiocNeighbors_1.6.0           cowplot_1.0.0                
## [101] bitops_1.0-6                  irlba_2.3.3                  
## [103] httpuv_1.5.4                  patchwork_1.0.1              
## [105] R6_2.4.1                      promises_1.1.1               
## [107] KernSmooth_2.23-17            gridExtra_2.3                
## [109] codetools_0.2-16              MASS_7.3-52                  
## [111] assertthat_0.2.1              withr_2.2.0                  
## [113] sctransform_0.2.1             GenomeInfoDbData_1.2.3       
## [115] mgcv_1.8-31                   grid_4.0.2                   
## [117] rpart_4.1-15                  rmarkdown_2.3                
## [119] DelayedMatrixStats_1.10.1     Rtsne_0.15                   
## [121] shiny_1.5.0
## Warning: Using `as.character()` on a quosure is deprecated as of rlang 0.3.0.
## Please use `as_label()` or `as_name()` instead.
## This warning is displayed once per session.

## 
##       enrMigr1         enrMpl enrNbeal_cntrl          Migr1            Mpl 
##            653           1315           1037           2144           2608 
##    Nbeal_cntrl 
##            911

## 
##     Enriched Not enriched 
##         3005         5663

## 
## Control   Migr1     Mpl 
##    1948    2797    3923

Introduction

In v2 of the analysis we decided to include the control mice from the Nbeal experiment with the Migr1 and Mpl mice. The thought is that it may be good to have another control, since the Migr1 control has irradiated and had a bone marrow transplantation. I’m going to split the Rmarkdown files into separate part, to better organize my analysis.

This File

I’m going to go with the consensus names from the labeling stage and produce figures covering the distribution of cell types within clusters, conditions (enriched/not enriched), experiments (Mpl, Migr, Nbeal_cnt), states(condition + experiment), etc.

UMAP Projections

UMAP projections of the data of different subsets of the data with the cell type labels.

##        B-cell        T cell    Macrophage   Granulocyte       MEP/MCP 
##          1464           203           351          4613           592 
##           CMP      Monocyte   Erythrocyte Megakarycoyte          HSPC 
##           355           600           312           120            58
## 
##        B-cell           CMP   Erythrocyte   Granulocyte          HSPC 
##          1464           355           312          4613            58 
##    Macrophage Megakarycoyte       MEP/MCP      Monocyte        T cell 
##           351           120           592           600           203

## 
##       enrMigr1         enrMpl enrNbeal_cntrl          Migr1            Mpl 
##            653           1315           1037           2144           2608 
##    Nbeal_cntrl 
##            911
##                 
##                  B-cell  CMP Erythrocyte Granulocyte HSPC Macrophage
##   enrMigr1          211   10          65         162    0        129
##   enrMpl              7   78          26         487    5         85
##   enrNbeal_cntrl    307    8          29         460   44         28
##   Migr1             775   82          76         815    3         69
##   Mpl                15  159         110        2095    0         35
##   Nbeal_cntrl       149   18           6         594    6          5
##                 
##                  Megakarycoyte MEP/MCP Monocyte T cell
##   enrMigr1                   8      12       42     14
##   enrMpl                    20     500      106      1
##   enrNbeal_cntrl            77      10       55     19
##   Migr1                      3      11      179    131
##   Mpl                        8      51      125     10
##   Nbeal_cntrl                4       8       93     28

## 
##     Enriched Not enriched 
##         3005         5663
##               
##                B-cell  CMP Erythrocyte Granulocyte HSPC Macrophage
##   Enriched        525   96         120        1109   49        242
##   Not enriched    939  259         192        3504    9        109
##               
##                Megakarycoyte MEP/MCP Monocyte T cell
##   Enriched               105     522      203     34
##   Not enriched            15      70      397    169

## 
## Control   Migr1     Mpl 
##    1948    2797    3923
##          
##           B-cell  CMP Erythrocyte Granulocyte HSPC Macrophage Megakarycoyte
##   Control    456   26          35        1054   50         33            81
##   Migr1      986   92         141         977    3        198            11
##   Mpl         22  237         136        2582    5        120            28
##          
##           MEP/MCP Monocyte T cell
##   Control      18      148     47
##   Migr1        23      221    145
##   Mpl         551      231     11

Quantification (Bar graphs & Tables/Heatmaps)

Quantification for each cluster

## [1] "B-cell"
## [1] "T cell"
## [1] "Macrophage"
## [1] "Granulocyte"
## [1] "MEP/MCP"
## [1] "CMP"
## [1] "Monocyte"
## [1] "Erythrocyte"
## [1] "Megakarycoyte"
## [1] "HSPC"